import os
from transformers import AutoTokenizer, AutoModel, AutoConfig

os.environ['HTTP_PROXY'] = 'http://127.0.0.1:10792'
os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:10792'

def get_model():
    """获取模型"""
    model = AutoModel.from_pretrained("uer/roberta-base-finetuned-dianping-chinese",force_download=True)
    return model

def get_config():
    """获取模型配置"""
    config = AutoConfig.from_pretrained("uer/roberta-base-finetuned-dianping-chinese")
    return config

if __name__ == '__main__':
    config = get_config()
    print(f"config:{config}")